import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router' 
import Layout from '@/layout/index.vue'
import children from 'pages-generated' // vite-plugin-pages 生成的路由信息
/**
 * 在 TS 中，直接从 `pages-generated` 导入会引起类型错误，
 * 需要在 `tsconfig.json` 的 `compilerOptions.types` 数组中
 * 加入 `vite-plugin-pages/client` 来加载对应的声明文件
 * */
// const Dashboard =()=> import(/* webpackChunkName: 'dashboard' */ '@/views/dashboard/index.vue')

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children
      
  }
]
export const router = createRouter({
  history: createWebHistory('/'),
  routes: routes
})